package main

import (
	"fmt"
)

type square interface {
	s() float64
}

type circle struct {
	r float64
}
type triangle struct {
	a float64
	b float64
}
type rectangle struct {
	len   float64
	width float64
}

func (c *circle) s() float64 {
	return 3.14 * (c.r) * (c.r)
}

func (t *triangle) s() float64 {
	return (t.a) * (t.b) / 2
}

func (r *rectangle) s() float64 {
	return (r.len) * (r.width)
}

func area(s square) float64 {
	return s.s()
}

var resC1, resR1, resT1 float64

func main() {
	c1 := &circle{2.5}
	resC1 = area(c1)
	fmt.Println(resC1)
	t1 := &triangle{10.5, 20.5}
	resT1 = area(t1)
	fmt.Println(resT1)
	r1 := &rectangle{1.5, 2.5}
	resR1 = area(r1)
	fmt.Println(resR1)
	fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	sortArea()
	fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	fmt.Println(fib(10))
	fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	tn := timeCreate()
	fmt.Println(tn)
	tp, tpMs, tpWeek, tpWeekPast, tnYearDay := timePast(tn)
	fmt.Printf("8年前的9:30为:%v\n8年前的毫秒时间戳为:%v\n该日期为周几：%v\n该日期已经过去了多少周？%v\n今年已经过去了多少天？%v\n",
		tp, tpMs, tpWeek, tpWeekPast, tnYearDay)
}
